<?php
/**
 * Created by PhpStorm.
 * User: 76683
 * Date: 2018/7/17
 * Time: 23:52
 */

namespace app\api\validate;


use think\Validate;

class WeTopicDetail extends Validate
{
    protected $rule = [
        'topic_id'=>'require|integer',
        'content'=>'require',
        'detail_id'=>'require|integer',
        'user_id'=>'require|integer',
        'id'=>'require|integer',
    ];
    protected $message = [
        'topic_id.require'=>'话题ID缺失',
        'topic_id.integer'=>'话题ID类型错误',
        'id.require'=>'话题ID缺失',
        'id.integer'=>'话题ID类型错误',
        'content.require'=>'评论内容不能为空',
        'detail_id.require'=>'评论ID缺失',
        'detail_id.integer'=>'评论ID类型错误',
        'user_id.require'=>'user_id缺失',
        'user_id.integer'=>'user_id类型错误',
    ];
    protected $scene =[
        'vote'=>['detail_id','user_id'],
        'add'=>['topic_id','content','user_id'],
        'list'=>['id']
    ];
}